package com.valten.job;

import com.valten.serive.IndexService;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

@Component
public class MyJob extends QuartzJobBean {

    @Autowired
    private IndexService indexService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) {
        //获取JobDetail中关联的数据
        String msg = (String) jobExecutionContext.getJobDetail().getJobDataMap().get("msg");
        indexService.testPrint(msg);
    }
}